package com.industry.framework.core.generic;

import com.industry.framework.common.Result;
import com.industry.framework.common.page.TableDataInfo;
import com.industry.framework.core.generic.record.dataobject.vo.RecordVo;
import com.industry.framework.core.generic.table.TableConfigInfo;
import com.industry.framework.core.wrapper.QueryTableWrapper;
import com.industry.framework.core.wrapper.RecordSearchWrapper;
import com.industry.framework.core.wrapper.UpdateWrapper;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Map;

/**
 * @Author nbZhuozh
 * @Date 2025-03-19  10:26
 **/
public interface GenericController<T,ID> extends BaseController {

    //查询列表查询搜索框配置
    Result<TableConfigInfo> tableListQueryConfiger();

    Result<List<T>> queryAll();

    //查询表单明细
    Result<T> queryDetails(String id);

    //通用列表查询
    Result<TableDataInfo<T>> queryList(QueryTableWrapper<T> queryTableWrapper);

    //id删除
    Result<Object> delById(String id);

    //批量id删除
    Result<Object> delByIds(Map<String,String> ids);

    //新增
    Result<Object> insert(T t);

    //新增或修改
    Result<Object> insertOrUpdate(T t);

    //批量新增
    Result<Object> insertBatch(List<T> list);

    //修改
    Result<Object> update(UpdateWrapper<T> t);

    //批量修改
    void updateBatch(List<T> list);

    //查询明细操作记录
    Result<List<RecordVo>> queryDetailsRecords(String id);

    //新增明细备注
    Result<Object> insertRecordRemark(Map<String,String> result);

//    //搜索备注
    Result<List<RecordVo>> queryDetailsRecords(RecordSearchWrapper recordSearchWrapper);
}
